﻿<%@ WebHandler Language="C#" Class="getActivity" %>

using System;
using System.Web;
using OneShoppingModel;
using OneShoppingBLL;
using OneshoppingWeb;
using System.Collections.Generic;
using OneShoppingUtility;
using System.Web.SessionState;

public class getActivity : IHttpHandler {

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        
      //  int pageIndex = Convert.ToInt32(context.Request["pageIndex"]);
        
       // List<Activity> list = ActivityBLL.GetInstance().GetList(r => r.Status == 3,6,pageIndex);

        List<Activity> list = ActivityBLL.GetInstance().GetList(r => r.Status == 3&&r.Surplus>0);
        if (list.Count == 0)
        {
            context.Response.Write(UtilityJson.ResListToJson((int)Protocol_activity.GET_ACTIVITY_FAIL, list));
        }
        else
        {
            context.Response.Write(UtilityJson.ResListToJson((int)Protocol_activity.GET_ACTIVITY_SUCCESS, list));
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}